home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / hintres / unit1.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-12-22  |  915 b   |  52 lines

  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Button1: TButton;
  12.     Button2: TButton;
  13.     Label1: TLabel;
  14.     Label2: TLabel;
  15.     procedure FormCreate(Sender: TObject);
  16.   private
  17.     { Private declarations }
  18.   public
  19.     { Public declarations }
  20.   end;
  21.  
  22. var
  23.   Form1: TForm1;
  24.  
  25. implementation
  26.  
  27. {$R *.DFM}
  28. {$R HINTS.RES}
  29.  
  30. procedure LoadFormHints(aForm: TForm);
  31. var
  32.   i: Integer;
  33.   resID: Longint;
  34. begin
  35.   for i := 0 to aForm.ComponentCount - 1 do begin
  36.     {Check for > 0 since some components may not have hints}
  37.     resID := aForm.Components[i].Tag;
  38.     if resID  > 0  then begin
  39.       TControl(aForm.Components[i]).Hint := LoadStr(resID);
  40.     end;
  41.   end;
  42. end;
  43.  
  44. procedure TForm1.FormCreate(Sender: TObject);
  45. begin
  46.   LoadFormHints(Self);
  47. end;
  48.  
  49. end.
  50.  
  51.  
  52.